public class Buffer {
byte[] buffer;
public Buffer(int size) {
buffer = new byte[size];
}
public byte[] toByteArray() {
return buffer;
}
public Iterator<Object> iterator() throws IOException, ClassNotFoundException {
ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(buffer));
return new Iterator<Object>() {
public boolean hasNext(){} //How to knnow next Object by ObjectInputStream
public Object next(){} ;// How to move to next Object
}}
что делает in.readObject()
в это время? Сомневаюсь, как получить буферный объект и как перейти к следующему объекту?