congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
StreamingMarshaller.finishObjectInput
Code IndexAdd Tabnine to your IDE (free)

How to use
finishObjectInput
method
in
org.infinispan.marshall.StreamingMarshaller

Best Java code snippets using org.infinispan.marshall.StreamingMarshaller.finishObjectInput (Showing top 3 results out of 315)

origin: org.infinispan/infinispan-custom52x-store

private Object objectFromInputStreamInReentrantMode(InputStream is) throws IOException, ClassNotFoundException, InterruptedException {
 int len = is.available();
 Object o = null;
 if (len != 0) {
   ExposedByteArrayOutputStream bytes = new ExposedByteArrayOutputStream(len);
   byte[] buf = new byte[Math.min(len, 1024)];
   int bytesRead;
   while ((bytesRead = is.read(buf, 0, buf.length)) != -1) {
    bytes.write(buf, 0, bytesRead);
   }
   is = new ByteArrayInputStream(bytes.getRawBuffer(), 0, bytes.size());
   ObjectInput unmarshaller = marshaller.startObjectInput(is, false);
   try {
    o = marshaller.objectFromObjectStream(unmarshaller);
   } finally {
    marshaller.finishObjectInput(unmarshaller);
   }
 }
 return o;
}
origin: org.infinispan/infinispan-custom52x-store

public void testToStream() throws Exception {
 cs.store(TestInternalCacheEntryFactory.create("k1", "v1", -1, -1));
 StreamingMarshaller marshaller = getMarshaller();
 ByteArrayOutputStream out = new ByteArrayOutputStream();
 ObjectOutput oo = marshaller.startObjectOutput(out, false, 12);
 try {
   cs.toStream(new UnclosableObjectOutputStream(oo));
 } finally {
   marshaller.finishObjectOutput(oo);
   out.close();
 }
 ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
 ObjectInput oi = marshaller.startObjectInput(in, false);
 try {
   assert oi.readInt() == 1 : "we have 3 different buckets";
   assert oi.readObject().equals(fcs.getLockFromKey("k1") + "");
   assert oi.readInt() > 0; //size on disk
 } finally {
   marshaller.finishObjectInput(oi);
 }
}
origin: org.infinispan/infinispan-custom52x-store

  cs.fromStream(new UnclosableObjectInputStream(oi));
} finally {
  marshaller.finishObjectInput(oi);
org.infinispan.marshallStreamingMarshallerfinishObjectInput

Javadoc

Finish using the given ObjectInput. After opening a ObjectInput and calling objectFromObjectStream() multiple times, use this method to flush the data and close if necessary

Popular methods of StreamingMarshaller

  • objectToByteBuffer
  • objectFromByteBuffer
  • objectFromObjectStream
    Unmarshalls an object from an java.io.ObjectInput
  • startObjectInput
    Create and open a new ObjectInput for the given input stream. This method should be used for opening
  • finishObjectOutput
    Finish using the given ObjectOutput. After opening a ObjectOutput and calling objectToObjectStream()
  • objectToObjectStream
    Marshalls an object to a given java.io.ObjectOutput
  • startObjectOutput

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • Kernel (java.awt.image)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now