private byte[] getProperty(NativeSlice nameSlice) { assertAllocated(); NativeStdString result = new NativeStdString(); try { if( DBJNI.GetProperty(self, nameSlice, result.pointer()) ) { return result.toByteArray(); } else { return null; } } finally { result.delete(); } }
public String toString() { assertAllocated(); long strptr = StatusJNI.ToString(self); if( strptr==0 ) { return null; } else { NativeStdString rc = new NativeStdString(strptr); try { return rc.toString(); } finally { rc.delete(); } } }
public void delete() { assertAllocated(); StdStringJNI.delete(self); self = 0; }
public byte[] toByteArray() { long l = length(); if( l > Integer.MAX_VALUE ) { throw new ArrayIndexOutOfBoundsException("Native string is larger than the maximum Java array"); } byte []rc = new byte[(int) l]; NativeBuffer.NativeBufferJNI.buffer_copy(StdStringJNI.c_str_ptr(self), 0, rc, 0, rc.length); return rc; } }
public String toString() { return new String(toByteArray()); }
public long length() { assertAllocated(); return StdStringJNI.length(self); }
public byte[] toByteArray() { long l = length(); if( l > Integer.MAX_VALUE ) { throw new ArrayIndexOutOfBoundsException("Native string is larger than the maximum Java array"); } byte []rc = new byte[(int) l]; NativeBuffer.NativeBufferJNI.buffer_copy(StdStringJNI.c_str_ptr(self), 0, rc, 0, rc.length); return rc; } }
public String toString() { return new String(toByteArray()); }
private byte[] getProperty(NativeSlice nameSlice) { assertAllocated(); NativeStdString result = new NativeStdString(); try { if( DBJNI.GetProperty(self, nameSlice, result.pointer()) ) { return result.toByteArray(); } else { return null; } } finally { result.delete(); } }
public String toString() { assertAllocated(); long strptr = StatusJNI.ToString(self); if( strptr==0 ) { return null; } else { NativeStdString rc = new NativeStdString(strptr); try { return rc.toString(); } finally { rc.delete(); } } }
public void delete() { assertAllocated(); StdStringJNI.delete(self); self = 0; }
public byte[] toByteArray() { long l = length(); if( l > Integer.MAX_VALUE ) { throw new ArrayIndexOutOfBoundsException("Native string is larger than the maximum Java array"); } byte []rc = new byte[(int) l]; NativeBuffer.NativeBufferJNI.buffer_copy(StdStringJNI.c_str_ptr(self), 0, rc, 0, rc.length); return rc; } }
public String toString() { return new String(toByteArray()); }
private byte[] getProperty(NativeSlice nameSlice) { assertAllocated(); NativeStdString result = new NativeStdString(); try { if( DBJNI.GetProperty(self, nameSlice, result.pointer()) ) { return result.toByteArray(); } else { return null; } } finally { result.delete(); } }
public String toString() { assertAllocated(); long strptr = StatusJNI.ToString(self); if( strptr==0 ) { return null; } else { NativeStdString rc = new NativeStdString(strptr); try { return rc.toString(); } finally { rc.delete(); } } }
public void delete() { assertAllocated(); StdStringJNI.delete(self); self = 0; }
private byte[] get(NativeReadOptions options, NativeSlice keySlice) throws DBException { assertAllocated(); NativeStdString result = new NativeStdString(); try { long s = DBJNI.Get(self, options, keySlice, result.pointer()); NativeStatus status = new NativeStatus(s); try { if(status.isOk()) { return result.toByteArray(); } if(status.isNotFound()) { return null; } throw new DBException(status.toString(), status.isNotFound()); } finally { status.delete(); } } finally { result.delete(); } }
public long length() { assertAllocated(); return StdStringJNI.length(self); }
private byte[] get(NativeReadOptions options, NativeSlice keySlice) throws DBException { assertAllocated(); NativeStdString result = new NativeStdString(); try { long s = DBJNI.Get(self, options, keySlice, result.pointer()); NativeStatus status = new NativeStatus(s); try { if(status.isOk()) { return result.toByteArray(); } if(status.isNotFound()) { return null; } throw new DBException(status.toString(), status.isNotFound()); } finally { status.delete(); } } finally { result.delete(); } }
public long length() { assertAllocated(); return StdStringJNI.length(self); }