Added benchmark lib

This commit is contained in:
Ziver Koc 2013-08-02 14:49:16 +00:00
parent fe66cc9962
commit b9a662e4b3
5 changed files with 169 additions and 44 deletions

View file

@ -89,6 +89,11 @@ public class JSONObjectOutputStream extends OutputStream implements ObjectOutput
out.write(new DataNode(s));
}
@Override
public void write(int b) throws IOException {
out.write(new DataNode(b));
}
public void writeUTF(String s) throws IOException {
out.write(new DataNode(s));
}
@ -98,6 +103,8 @@ public class JSONObjectOutputStream extends OutputStream implements ObjectOutput
out.write(getDataNode(obj));
} catch (IllegalAccessException e) {
throw new IOException("Unable to serialize object", e);
} finally {
objectCache.clear();
}
}
@ -185,11 +192,6 @@ public class JSONObjectOutputStream extends OutputStream implements ObjectOutput
return node;
}
@Override
public void write(int b) throws IOException {
// TODO:
}
/**
* Enable or disables the use of meta data in the JSON
* stream for class def and caching.
@ -200,11 +202,4 @@ public class JSONObjectOutputStream extends OutputStream implements ObjectOutput
generateMetaData = generate;
}
/**
* Reset the Object stream (clears the cache)
*/
public void reset(){
objectCache.clear();
}
}