@Override public int available() throws IOException { return wrapped.available(); }
/** {@inheritDoc} */ @Override public int available() throws IOException { return ois.available(); }
/** {@inheritDoc} */ @Override public int available() throws IOException { return ois.available(); }
/** {@inheritDoc} */ public int available() throws IOException { return ois.available(); }
@Override public int available() throws IOException { return wrapped.available(); }
/** * Load {@link #dataKeyStore} with data from the input stream. * * @param inputStream to load data from * @throws IOException if something goes wrong */ void load(InputStream inputStream) throws IOException, GeneralSecurityException { dataKeyStore.load(null, null); ObjectInputStream ois = new ObjectInputStream(inputStream); int fileVersion = ois.readInt(); if (fileVersion == VERSION) { while (ois.available() > 0) { int entryType = ois.readInt(); if (entryType == SECRET_KEY_ENTRY_TYPE) { loadSecretKey(ois); } else { throw log.unrecognizedEntryType(Integer.toString(entryType)); } } } else { throw log.unexpectedFileVersion(Integer.toString(fileVersion)); } ois.close(); }
while (in.available() > 0) { writable.readFields(in);
while (in.available() > 0) { writable.readFields(in);
@Override public Object fromByteBuffer(ByteBuffer bytes) { if ((bytes == null) || !bytes.hasRemaining()) { return null; } try { int l = bytes.remaining(); ByteArrayInputStream bais = new ByteArrayInputStream(bytes.array(), bytes.arrayOffset() + bytes.position(), l); ObjectInputStream ois; if(classLoader == null) { ois = new ObjectInputStream(bais); } else { ois = new CustomClassLoaderObjectInputStream(classLoader, bais); } Object obj = ois.readObject(); bytes.position(bytes.position() + (l - ois.available())); ois.close(); return obj; } catch (Exception ex) { throw new HectorSerializationException(ex); } }
/** {@inheritDoc} */ @Override public int available() throws IOException { return ois.available(); }
/** {@inheritDoc} */ public int available() throws IOException { return ois.available(); }
/** {@inheritDoc} */ public int available() throws IOException { return ois.available(); }
/** {@inheritDoc} */ public int available() throws IOException { return ois.available(); }
/** {@inheritDoc} */ public int available() throws IOException { return ois.available(); }
ObjectInputStream messages= new ObjectInputStream(new FileInputStream("serializer.txt")); while(messages.available()){ MimeMessage message = (MimeMessage)messages.readObject() .... }
FileInputStream fstream = new FileInputStream(fileName); try { ObjectInputStream ostream = new ObjectInputStream(fstream); while (ostream.available() > 0) { Object obj = ostream.readObject(); // do something with obj } } finally { fstream.close(); }
List<Object> objects = new ArrayList<Object>(); ObjectInputStream input = new ObjectInputStream(new FileInputStream("path/to/file")); while (input.available() > 0) { Object anObject = input.readObject(); objects.add(anObject); }
public static void read(String fileName) throws FileNotFoundException, IOException,NumberFormatException { try(ObjectInputStream i = new ObjectInputStream(new BufferedInputStream(new FileInputStream(fileName)))){ while (i.available()>0) { int id=Integer.parseInt((readFixedLengthString(ID_SIZE,i))); String name=readFixedLengthString(NAME_SIZE,i); String grade=readFixedLengthString(GRADE_SIZE,i); System.out.println(new Student<>(id, name,grade)); } } }
@Override public int availableBytes() throws FileNotFoundException, IOException, ClassNotFoundException { lazyInit(); if (ois != null) { return ois.available(); } return 0; }