org.drizzle.jdbc.internal.common.packet.buffer
Class ReadUtil

java.lang.Object
  extended by org.drizzle.jdbc.internal.common.packet.buffer.ReadUtil

public final class ReadUtil
extends java.lang.Object

. User: marcuse Date: Jan 16, 2009 Time: 8:27:38 PM


Method Summary
static boolean eofIsNext(RawPacket rawPacket)
          Checks whether the next packet is EOF.
static boolean isErrorPacket(RawPacket rawPacket)
           
static int safeRead(java.io.InputStream inputStream, byte[] buffer)
          Read a number of bytes from the stream and store it in the buffer, and fix the problem with "incomplete" reads by doing another read if we don't have all of the data yet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

safeRead

public static int safeRead(java.io.InputStream inputStream,
                           byte[] buffer)
                    throws java.io.IOException
Read a number of bytes from the stream and store it in the buffer, and fix the problem with "incomplete" reads by doing another read if we don't have all of the data yet.

Parameters:
inputStream - the input stream to read from
buffer - where to store the data
Returns:
the number of bytes read (should be == length if we didn't hit EOF)
Throws:
java.io.IOException - if an error occurs while reading the stream

eofIsNext

public static boolean eofIsNext(RawPacket rawPacket)
Checks whether the next packet is EOF.

Parameters:
rawPacket - the raw packet
Returns:
true if the packet is an EOF packet

isErrorPacket

public static boolean isErrorPacket(RawPacket rawPacket)


Copyright © 2012. All Rights Reserved.