@Test public void test() { byte[] content = new String("123").getBytes(StandardCharsets.UTF_8); byte [] readBy = new byte[2]; InMemoryInputStream stream = new InMemoryInputStream(content); for (int index=0; index < 25; index++) { int read = stream.read(readBy, 0, readBy.length); puts(read, readBy, new String(readBy, StandardCharsets.UTF_8)); } }
public final int read() { if (position >= buffer.length) { return -1; } value = buffer [position]; position++; return value & 0xff; }
InMemoryInputStream extends ByteArrayInputStream { public final int read() { if (position >= buffer.length) { return -1; } value = buffer [position]; position++; return value & 0xff; } }
InMemoryInputStream extends ByteArrayInputStream { public final int read() { if (position >= buffer.length) { return -1; } value = buffer [position]; position++; return value & 0xff; } InMemoryInputStream(byte[] buffer); }
InMemoryInputStream extends ByteArrayInputStream { public final int read() { if (position >= buffer.length) { return -1; } value = buffer [position]; position++; return value & 0xff; } InMemoryInputStream(byte[] buffer); final int read(); int read(byte b[]); final int read(byte destination[], int destinationOffset, int destinationLength); final long skip(long n); final int available(); final void mark(int limit); final void reset(); final boolean markSupported(); final void close(); }
InMemoryInputStream extends ByteArrayInputStream { public final int read() { if (position >= buffer.length) { return -1; } value = buffer [position]; position++; return value & 0xff; } InMemoryInputStream(byte[] buffer); final int read(); int read(byte b[]); final int read(byte destination[], int destinationOffset, int destinationLength); final long skip(long n); final int available(); final void mark(int limit); final void reset(); final boolean markSupported(); final void close();  }