congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
UnsafeByteArrayInputStream.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
net.jahhan.com.alibaba.dubbo.common.io.UnsafeByteArrayInputStream
constructor

Best Java code snippets using net.jahhan.com.alibaba.dubbo.common.io.UnsafeByteArrayInputStream.<init> (Showing top 6 results out of 315)

origin: net.jahhan/common-plugin-util

public T parseFrom(byte[] b) throws IOException
{
  return parseFrom(new UnsafeByteArrayInputStream(b));
}
origin: net.jahhan/common-plugin-util

  @Override
  public Serializable parseFrom(GenericObjectInput in) throws IOException
  {
    byte b = in.read0();
    if( b == OBJECT_NULL )
      return null;
    if( b != OBJECT_STREAM )
      throw new IOException("Input format error, expect OBJECT_NULL|OBJECT_STREAM, get " + b + ".");
    UnsafeByteArrayInputStream bis = new UnsafeByteArrayInputStream(in.read0(in.readUInt()));
    CompactedObjectInputStream ois = new CompactedObjectInputStream(bis);
    try{ return (Serializable)ois.readObject(); }
    catch(ClassNotFoundException e){ throw new IOException(StringUtils.toString(e)); }
  }
};
origin: net.jahhan/common-plugin-util

/**
 * unzip.
 * 
 * @param bytes compressed byte array.
 * @return byte uncompressed array.
 * @throws IOException
 */
public static byte[] unzip(byte[] bytes) throws IOException
{
  UnsafeByteArrayInputStream bis = new UnsafeByteArrayInputStream(bytes);
  UnsafeByteArrayOutputStream bos = new UnsafeByteArrayOutputStream();
  InputStream is = new InflaterInputStream(bis);
  try
  {
    IOUtils.write(is, bos);
    return bos.toByteArray();
  }
  finally
  {
    is.close();
    bis.close();
    bos.close();
  }
}
origin: net.jahhan/dubbo-remoting-api

public Object decode(Channel channel, ChannelBuffer buffer) throws IOException {
  byte[] bytes = new byte[buffer.readableBytes()];
  int savedReaderIndex = buffer.readerIndex();
  buffer.readBytes(bytes);
  UnsafeByteArrayInputStream is = new UnsafeByteArrayInputStream(bytes);
  Object result = codec.decode(channel, is);
  buffer.readerIndex(savedReaderIndex + is.position());
  return result == Codec.NEED_MORE_INPUT ? DecodeResult.NEED_MORE_INPUT : result;
}
 
origin: net.jahhan/dubbo-rpc-api

if (byte[].class == args[i].getClass()) {
  try {
    UnsafeByteArrayInputStream is = new UnsafeByteArrayInputStream((byte[]) args[i]);
    args[i] = ExtensionExtendUtil
        .getExtension(Serialization.class, Constants.GENERIC_SERIALIZATION_NATIVE_JAVA)
origin: net.jahhan/dubbo-rpc-default

  } else {
    result = new DecodeableRpcResult(channel, res,
        new UnsafeByteArrayInputStream(readMessageData(is)),
        (Invocation) getRequestData(id), proto);
} else {
  inv = new DecodeableRpcInvocation(channel, req,
      new UnsafeByteArrayInputStream(readMessageData(is)), proto);
net.jahhan.com.alibaba.dubbo.common.ioUnsafeByteArrayInputStream<init>

Popular methods of UnsafeByteArrayInputStream

  • close
  • position

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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