insert values into root node
This commit is contained in:
@@ -35,8 +35,9 @@ public class PersistentMap {
|
||||
}
|
||||
}
|
||||
|
||||
public void put(final String key, final long value) throws IOException {
|
||||
put(key.getBytes(UTF8), VariableByteEncoder.encode(value));
|
||||
public Long put(final String key, final long value) throws IOException {
|
||||
final byte[] oldValue = put(key.getBytes(UTF8), VariableByteEncoder.encode(value));
|
||||
return oldValue == null ? null : VariableByteEncoder.decodeFirstValue(oldValue);
|
||||
}
|
||||
|
||||
public long getAsLong(final String key) throws IOException {
|
||||
@@ -44,8 +45,9 @@ public class PersistentMap {
|
||||
return buffer == null ? null : VariableByteEncoder.decodeFirstValue(buffer);
|
||||
}
|
||||
|
||||
public void put(final String key, final String value) throws IOException {
|
||||
put(key.getBytes(UTF8), value.getBytes(UTF8));
|
||||
public String put(final String key, final String value) throws IOException {
|
||||
final byte[] oldValue = put(key.getBytes(UTF8), value.getBytes(UTF8));
|
||||
return oldValue == null ? null : new String(oldValue, UTF8);
|
||||
}
|
||||
|
||||
public String getAsString(final String key) throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user