public Object put(Object key, Object value) { return doConsistentModify(key, new ConsistentPut(value)); }
public Object remove(Object key) { return doConsistentModify(key, new ConsistentRemove()); }
public void read(InputStream stream) throws IOException { if(null == stream) { this.content = null; } else { this.content = StreamUtil.getStreamAsByteArray(stream); } }
private boolean doSimpleMatch(String source, String query) { if(exactMatch) { return StringUtil.matchesExact(source, query, caseSensitive); } else { return StringUtil.matchesContains(source, query, caseSensitive); } }
/** * Returns a byte array containing the bytes from the <code>List</code>. * The <code>List</code> must contain <code>Byte</code> objects. * <code>null</code> entries in the <code>List</code> are * allowed, the resulting byte will be 0. * @param data the <code>List</code> * @return the resulting byte array */ public static byte[] getByteArrayFromList(List data) { return getByteArrayFromList(data, 0); }
/** * Returns the contents of the reader as a string. * @param reader the <code>Reader</code> * @return the reader content as <code>String</code> */ public static String getReaderAsString(Reader reader) { return getReaderAsString(reader, -1); }
public MockBlob(byte[] data) { blobData = ArrayUtil.getListFromByteArray(data); wasFreeCalled = false; }
/** * Returns the index of the first occurence of the * array <i>bytes</i> in the array <i>source</i>. * @param source the array in which to search * @param bytes the array to search * @return the index of the first occurence or * -1, if <i>source</i> does not contain <i>bytes</i> */ public static int indexOf(byte[] source, byte[] bytes) { return indexOf(source, bytes, 0); }
public MockUpdateCountArrayWrapper(int[] updateCounts, Map parameters) { super(parameters); this.updateCounts = (Integer[])ArrayUtil.convertToObjectArray(updateCounts); }
public void write(int byteValue) throws IOException { byte[] bytes = new byte[] {(byte)byteValue}; ArrayUtil.addBytesToList(bytes, blobData, index); index++; } }
public MockArray(Object array) { this.array = ArrayUtil.convertToArray(array); }
/** * Returns the contents of the input stream as byte array. * @param stream the <code>InputStream</code> * @return the stream content as byte array */ public static byte[] getStreamAsByteArray(InputStream stream) { return getStreamAsByteArray(stream, -1); }
public Object put(Object key, Object value) { return doConsistentModify(key, new ConsistentPut(value)); }
public Object remove(Object key) { return doConsistentModify(key, new ConsistentRemove()); }
/** * Returns a byte array containing the bytes from the <code>List</code>. * The <code>List</code> must contain <code>Byte</code> objects. * <code>null</code> entries in the <code>List</code> are * allowed, the resulting byte will be 0. * @param data the <code>List</code> * @return the resulting byte array */ public static byte[] getByteArrayFromList(List data) { return getByteArrayFromList(data, 0); }
/** * Returns the contents of the reader as a string. * @param reader the <code>Reader</code> * @return the reader content as <code>String</code> */ public static String getReaderAsString(Reader reader) { return getReaderAsString(reader, -1); }
public MockBlob(byte[] data) { blobData = ArrayUtil.getListFromByteArray(data); wasFreeCalled = false; }
public void read(InputStream stream) throws IOException { if(null == stream) { this.content = null; } else { this.content = StreamUtil.getStreamAsByteArray(stream); } }
/** * Returns the contents of the input stream as byte array. * @param stream the <code>InputStream</code> * @return the stream content as byte array */ public static byte[] getStreamAsByteArray(InputStream stream) { return getStreamAsByteArray(stream, -1); }
public void read(InputStream stream) throws IOException { if(null == stream) { this.content = null; } else { this.content = StreamUtil.getStreamAsByteArray(stream); } }