public long skip(long n) throws IOException { int available = available(); int c = n < available ? (int)n : available; int newOffset = currentChunkOffset + c; int chunkDelta = newOffset/chunkSize; currentChunkIndex += chunkDelta; currentChunkOffset = newOffset - (chunkDelta*chunkSize); return c; }
private static void assertPositive(int port) { if (port < 0) { handleException("Invalid port number : " + port); } }
public int read() throws IOException { byte[] b = new byte[1]; return read(b) == -1 ? -1 : (int)b[0] & 0xFF; }
private boolean isValid(Properties dsProperties) { String dataSources = MiscellaneousUtil.getProperty(dsProperties, DataSourceConstants.PROP_SYNAPSE_PREFIX_DS, null); if (dataSources != null && !"".equals(dataSources)) { String[] dataSourcesNames = dataSources.split(","); return !(dataSourcesNames == null || dataSourcesNames.length == 0); } return false; } }
public void write(byte[] b) throws IOException { write(b, 0, b.length); }
public OutputStream getOutputStream() { return new OutputStreamImpl(); }
public InputStream getInputStream() throws IOException { if (temporaryFile != null) { return new FileInputStream(temporaryFile); } else { return new InputStreamImpl(); } }
private boolean isValid(Properties dsProperties) { String dataSources = MiscellaneousUtil.getProperty(dsProperties, DataSourceConstants.PROP_SYNAPSE_PREFIX_DS, null); if (dataSources != null && !"".equals(dataSources)) { String[] dataSourcesNames = dataSources.split(","); return !(dataSourcesNames == null || dataSourcesNames.length == 0); } return false; } }
public int read() throws IOException { byte[] b = new byte[1]; return read(b) == -1 ? -1 : (int)b[0] & 0xFF; }
public void write(int b) throws IOException { write(new byte[] { (byte)b }, 0, 1); }
public long skip(long n) throws IOException { int available = available(); int c = n < available ? (int)n : available; int newOffset = currentChunkOffset + c; int chunkDelta = newOffset/chunkSize; currentChunkIndex += chunkDelta; currentChunkOffset = newOffset - (chunkDelta*chunkSize); return c; }
private static void assertPositive(int port) { if (port < 0) { handleException("Invalid port number : " + port); } }
public OutputStream getOutputStream() { return new OutputStreamImpl(); }
public InputStream getInputStream() throws IOException { if (temporaryFile != null) { return new FileInputStream(temporaryFile); } else { return new InputStreamImpl(); } }
/** * Load a value of the property from the synapse properties * * @param key Key of the property * @param defaultValue Default value * @return Value of the property */ public static String getPropertyValue(String key, String defaultValue) { return MiscellaneousUtil.getProperty(loadSynapseProperties(), key, defaultValue); } }
public int read(byte[] b) throws IOException { return read(b, 0, b.length); }
public void write(byte[] b) throws IOException { write(b, 0, b.length); }
/** * Load a value of the property from the synapse properties * * @param key Key of the property * @param defaultValue Default value * @return Value of the property */ public static String getPropertyValue(String key, String defaultValue) { return MiscellaneousUtil.getProperty(loadSynapseProperties(), key, defaultValue); }
public int read(byte[] b) throws IOException { return read(b, 0, b.length); }
public void write(int b) throws IOException { write(new byte[] { (byte)b }, 0, 1); }