Tabnine Logo
ByteBufferInput
Code IndexAdd Tabnine to your IDE (free)

How to use
ByteBufferInput
in
org.jboss.marshalling

Best Java code snippets using org.jboss.marshalling.ByteBufferInput (Showing top 16 results out of 315)

origin: wildfly/wildfly

/**
 * Create a {@code ByteInput} wrapper for a {@code ByteBuffer}.
 *
 * @param buffer the byte buffer
 * @return the byte input wrapper
 */
public static ByteInput createByteInput(final ByteBuffer buffer) {
  return new ByteBufferInput(buffer);
}
origin: wildfly/wildfly

/** {@inheritDoc} */
public int read(final byte[] b) throws IOException {
  return read(b, 0, b.length);
}
origin: wildfly/wildfly

private Object deserialize(final String info) throws IOException, ClassNotFoundException {
  byte[] data = Base64.getDecoder().decode(info.trim());
  Unmarshaller unmarshaller = factory.createUnmarshaller(configuration);
  unmarshaller.start(new ByteBufferInput(ByteBuffer.wrap(data)));
  try {
    return unmarshaller.readObject();
  } finally {
    unmarshaller.close();
  }
}
origin: org.jboss.marshalling/jboss-marshalling

/** {@inheritDoc} */
public int read(final byte[] b) throws IOException {
  return read(b, 0, b.length);
}
origin: wildfly/wildfly

@Override
public Map<String, PersistentSession> loadSessionAttributes(String deploymentName, final ClassLoader classLoader) {
  try {
    Unmarshaller unmarshaller = createUnmarshaller();
    try {
      long time = System.currentTimeMillis();
      Map<String, SessionEntry> data = loadSerializedSessions(deploymentName);
      if (data != null) {
        Map<String, PersistentSession> ret = new HashMap<String, PersistentSession>();
        for (Map.Entry<String, SessionEntry> sessionEntry : data.entrySet()) {
          if (sessionEntry.getValue().expiry.getTime() > time) {
            Map<String, Object> session = new HashMap<String, Object>();
            for (Map.Entry<String, byte[]> sessionAttribute : sessionEntry.getValue().data.entrySet()) {
              unmarshaller.start(new ByteBufferInput(ByteBuffer.wrap(sessionAttribute.getValue())));
              session.put(sessionAttribute.getKey(), unmarshaller.readObject());
              unmarshaller.finish();
            }
            ret.put(sessionEntry.getKey(), new PersistentSession(sessionEntry.getValue().expiry, session));
          }
        }
        return ret;
      }
    } finally {
      unmarshaller.close();
    }
  } catch (Exception e) {
    UndertowServletLogger.ROOT_LOGGER.failedtoLoadPersistentSessions(e);
  }
  return null;
}
origin: org.jboss.marshalling/jboss-marshalling-osgi

/** {@inheritDoc} */
public int read(final byte[] b) throws IOException {
  return read(b, 0, b.length);
}
origin: org.jboss.eap/wildfly-client-all

/**
 * Create a {@code ByteInput} wrapper for a {@code ByteBuffer}.
 *
 * @param buffer the byte buffer
 * @return the byte input wrapper
 */
public static ByteInput createByteInput(final ByteBuffer buffer) {
  return new ByteBufferInput(buffer);
}
origin: jboss-remoting/jboss-marshalling

/** {@inheritDoc} */
public int read(final byte[] b) throws IOException {
  return read(b, 0, b.length);
}
origin: org.jboss.marshalling/jboss-marshalling

/**
 * Create a {@code ByteInput} wrapper for a {@code ByteBuffer}.
 *
 * @param buffer the byte buffer
 * @return the byte input wrapper
 */
public static ByteInput createByteInput(final ByteBuffer buffer) {
  return new ByteBufferInput(buffer);
}
origin: jboss-remoting/jboss-marshalling

/** {@inheritDoc} */
public int read(final byte[] b) throws IOException {
  return read(b, 0, b.length);
}
origin: org.jboss.marshalling/jboss-marshalling-osgi

/**
 * Create a {@code ByteInput} wrapper for a {@code ByteBuffer}.
 *
 * @param buffer the byte buffer
 * @return the byte input wrapper
 */
public static ByteInput createByteInput(final ByteBuffer buffer) {
  return new ByteBufferInput(buffer);
}
origin: org.jboss.eap/wildfly-client-all

/** {@inheritDoc} */
public int read(final byte[] b) throws IOException {
  return read(b, 0, b.length);
}
origin: jboss-remoting/jboss-marshalling

/**
 * Create a {@code ByteInput} wrapper for a {@code ByteBuffer}.
 *
 * @param buffer the byte buffer
 * @return the byte input wrapper
 */
public static ByteInput createByteInput(final ByteBuffer buffer) {
  return new ByteBufferInput(buffer);
}
origin: jboss-remoting/jboss-marshalling

/**
 * Create a {@code ByteInput} wrapper for a {@code ByteBuffer}.
 *
 * @param buffer the byte buffer
 * @return the byte input wrapper
 */
public static ByteInput createByteInput(final ByteBuffer buffer) {
  return new ByteBufferInput(buffer);
}
origin: org.jboss.eap/wildfly-undertow

@Override
public Map<String, PersistentSession> loadSessionAttributes(String deploymentName, final ClassLoader classLoader) {
  try {
    Unmarshaller unmarshaller = createUnmarshaller();
    try {
      long time = System.currentTimeMillis();
      Map<String, SessionEntry> data = loadSerializedSessions(deploymentName);
      if (data != null) {
        Map<String, PersistentSession> ret = new HashMap<String, PersistentSession>();
        for (Map.Entry<String, SessionEntry> sessionEntry : data.entrySet()) {
          if (sessionEntry.getValue().expiry.getTime() > time) {
            Map<String, Object> session = new HashMap<String, Object>();
            for (Map.Entry<String, byte[]> sessionAttribute : sessionEntry.getValue().data.entrySet()) {
              unmarshaller.start(new ByteBufferInput(ByteBuffer.wrap(sessionAttribute.getValue())));
              session.put(sessionAttribute.getKey(), unmarshaller.readObject());
              unmarshaller.finish();
            }
            ret.put(sessionEntry.getKey(), new PersistentSession(sessionEntry.getValue().expiry, session));
          }
        }
        return ret;
      }
    } finally {
      unmarshaller.close();
    }
  } catch (Exception e) {
    UndertowServletLogger.ROOT_LOGGER.failedtoLoadPersistentSessions(e);
  }
  return null;
}
origin: org.wildfly/wildfly-undertow

@Override
public Map<String, PersistentSession> loadSessionAttributes(String deploymentName, final ClassLoader classLoader) {
  try {
    Unmarshaller unmarshaller = createUnmarshaller();
    try {
      long time = System.currentTimeMillis();
      Map<String, SessionEntry> data = loadSerializedSessions(deploymentName);
      if (data != null) {
        Map<String, PersistentSession> ret = new HashMap<String, PersistentSession>();
        for (Map.Entry<String, SessionEntry> sessionEntry : data.entrySet()) {
          if (sessionEntry.getValue().expiry.getTime() > time) {
            Map<String, Object> session = new HashMap<String, Object>();
            for (Map.Entry<String, byte[]> sessionAttribute : sessionEntry.getValue().data.entrySet()) {
              unmarshaller.start(new ByteBufferInput(ByteBuffer.wrap(sessionAttribute.getValue())));
              session.put(sessionAttribute.getKey(), unmarshaller.readObject());
              unmarshaller.finish();
            }
            ret.put(sessionEntry.getKey(), new PersistentSession(sessionEntry.getValue().expiry, session));
          }
        }
        return ret;
      }
    } finally {
      unmarshaller.close();
    }
  } catch (Exception e) {
    UndertowServletLogger.ROOT_LOGGER.failedtoLoadPersistentSessions(e);
  }
  return null;
}
org.jboss.marshallingByteBufferInput

Javadoc

An InputStream which implements ByteInput and reads bytes from a ByteBuffer.

Most used methods

  • <init>
    Construct a new instance.
  • read

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSharedPreferences (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JTextField (javax.swing)
  • Top PhpStorm plugins
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