private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { final int length = in.readInt(); if (length != NO_IMAGE) { final byte[] imageByteArray = new byte[length]; in.readFully(imageByteArray); image = BitmapFactory.decodeByteArray(imageByteArray, 0, length); } }
/* */ private void readObject(ObjectInputStream paramObjectInputStream) /* */ throws IOException, ClassNotFoundException /* */ { /* 553 */ Hashtable localHashtable = null; /* */ /* 555 */ paramObjectInputStream.defaultReadObject(); /* */ /* 557 */ if (this.type == null) { /* 558 */ throw new NullPointerException("type can't be null"); /* */ } /* */ /* 561 */ int i = paramObjectInputStream.readInt(); /* 562 */ if (i > 0) /* */ { /* 565 */ localHashtable = new Hashtable(3); /* 566 */ this.certs = new Certificate[i]; /* */ } /* */ /* 569 */ for (int j = 0; j < i; j++) /* */ { /* 572 */ String str = paramObjectInputStream.readUTF(); /* */ CertificateFactory localCertificateFactory; /* 573 */ if (localHashtable.containsKey(str)) /* */ { /* 575 */ localCertificateFactory = (CertificateFactory) localHashtable.get(str); /* */ } /* */ else { /* */ try { /* 579 */ localCertificateFactory = CertificateFactory.getInstance(str); /* */ } catch (CertificateException localCertificateException1) { /* 581 */ throw new ClassNotFoundException( "Certificate factory for " + str + " not found"); /* */ } /* */ /* 585 */ localHashtable.put(str, localCertificateFactory); /* */ } /* */ /* 588 */ byte[] arrayOfByte = null; /* */ try { /* 590 */ arrayOfByte = new byte[paramObjectInputStream.readInt()]; /* */ } catch (OutOfMemoryError localOutOfMemoryError) { /* 592 */ throw new IOException("Certificate too big"); /* */ } /* 594 */ paramObjectInputStream.readFully(arrayOfByte); /* 595 */ ByteArrayInputStream localByteArrayInputStream = new ByteArrayInputStream(arrayOfByte); /* */ try { /* 597 */ this.certs[j] = localCertificateFactory.generateCertificate(localByteArrayInputStream); /* */ } catch (CertificateException localCertificateException2) { /* 599 */ throw new IOException(localCertificateException2.getMessage()); /* */ } /* 601 */ localByteArrayInputStream.close(); /* */ } /* */ }
/** java.io.ObjectOutputStream#writeBytes(java.lang.String) */ public void test_writeBytesLjava_lang_String() throws Exception { // Test for method void // java.io.ObjectOutputStream.writeBytes(java.lang.String) byte[] buf = new byte[10]; oos.writeBytes("HelloWorld"); oos.close(); ois = new ObjectInputStream(new ByteArrayInputStream(bao.toByteArray())); ois.readFully(buf); ois.close(); assertEquals("Wrote incorrect bytes value", "HelloWorld", new String(buf, 0, 10, "UTF-8")); }
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _length = in.readInt(); _p = in.readDouble(); final int bytes = in.readInt(); _genes = new byte[bytes]; in.readFully(_genes); _seq = BitGeneISeq.of(_genes, _length); }