public static byte[] read(URL u) throws IOException { return read(u.openStream()); }
private ByteBuffer getBuffer() throws Exception { if (buffer != null) { return buffer; } if (size == -1) { return buffer = ByteBuffer.wrap(IO.read(zip.getInputStream(entry))); } ByteBuffer bb = IO.copy(zip.getInputStream(entry), ByteBuffer.allocate((int) size)); bb.flip(); return buffer = bb; }
public static byte[] read(URL url) throws IOException { URLConnection conn = url.openConnection(); conn.connect(); int length = conn.getContentLength(); if (length == -1) { return read(conn.getInputStream()); } return copy(conn.getInputStream(), new byte[length]); }
@Override public ByteBuffer buffer() throws Exception { if (buffer != null) { return buffer.duplicate(); } if (IO.isWindows() && (size > THRESHOLD)) { return null; } return (buffer = IO.read(file)).duplicate(); }
private ByteBuffer getBuffer() throws Exception { if (buffer != null) { return buffer; } if (size == -1) { return buffer = ByteBuffer.wrap(IO.read(zip.getInputStream(entry))); } ByteBuffer bb = IO.copy(zip.getInputStream(entry), ByteBuffer.allocate((int) size)); bb.flip(); return buffer = bb; }
public static byte[] read(URL url) throws IOException { URLConnection conn = url.openConnection(); conn.connect(); int length = conn.getContentLength(); if (length == -1) { return read(conn.getInputStream()); } return copy(conn.getInputStream(), new byte[length]); }
public static byte[] read(URL url) throws IOException { URLConnection conn = url.openConnection(); conn.connect(); int length = conn.getContentLength(); if (length == -1) { return read(conn.getInputStream()); } return copy(conn.getInputStream(), new byte[length]); }
@Override public ByteBuffer buffer() throws Exception { if (buffer != null) { return buffer.duplicate(); } if (IO.isWindows() && (size > THRESHOLD)) { return null; } return (buffer = IO.read(file)).duplicate(); }
public static byte[] read(URL url) throws IOException { URLConnection conn = url.openConnection(); conn.connect(); int length = conn.getContentLength(); if (length == -1) { return read(conn.getInputStream()); } return copy(conn.getInputStream(), new byte[length]); }
public static byte[] read(URL url) throws IOException { URLConnection conn = url.openConnection(); conn.connect(); int length = conn.getContentLength(); if (length == -1) { return read(conn.getInputStream()); } return copy(conn.getInputStream(), new byte[length]); }
public static byte[] read(URL url) throws IOException { URLConnection conn = url.openConnection(); conn.connect(); int length = conn.getContentLength(); if (length == -1) { return read(conn.getInputStream()); } return copy(conn.getInputStream(), new byte[length]); }
public static byte[] read(URL url) throws IOException { URLConnection conn = url.openConnection(); conn.connect(); int length = conn.getContentLength(); if (length == -1) { return read(conn.getInputStream()); } return copy(conn.getInputStream(), new byte[length]); }
private ByteBuffer getBuffer() throws Exception { if (buffer != null) { return buffer; } InputStream in = open(); if (size == -1) { return buffer = ByteBuffer.wrap(IO.read(in)); } ByteBuffer bb = IO.copy(in, ByteBuffer.allocate(size)); bb.flip(); return buffer = bb; }
private ByteBuffer getBuffer() throws Exception { if (buffer != null) { return buffer; } InputStream in = open(); if (size == -1) { return buffer = ByteBuffer.wrap(IO.read(in)); } ByteBuffer bb = IO.copy(in, ByteBuffer.allocate(size)); bb.flip(); return buffer = bb; }
public void load(File file, Reporter reporter, String[] syntaxHeaders) throws Exception { String source = decode(IO.read(file)); load(source, file, reporter, syntaxHeaders); }
public void load(InputStream in, File file, Reporter reporter, String[] syntaxHeaders) throws IOException { String source = decode(IO.read(in)); load(source, file, reporter, syntaxHeaders); }
public void load(InputStream in, File file, Reporter reporter, String[] syntaxHeaders) throws IOException { String source = decode(IO.read(in)); load(source, file, reporter, syntaxHeaders); }
public void load(InputStream in, File file, Reporter reporter, String[] syntaxHeaders) throws IOException { String source = decode(IO.read(in)); load(source, file, reporter, syntaxHeaders); }
public void load(InputStream in, File file, Reporter reporter, String[] syntaxHeaders) throws IOException { String source = decode(IO.read(in)); load(source, file, reporter, syntaxHeaders); }
private Object convert(Type ref, InputStream in) throws IOException, Exception { if (ref instanceof Class) { Class<?> refc = (Class<?>) ref; if (refc == byte[].class) { return IO.read(in); } else if (InputStream.class.isAssignableFrom((refc))) { return in; } else if (String.class == refc) { return IO.collect(in); } } String s = IO.collect(in); return codec.dec() .from(s) .get(ref); }