public abstract class ParameterBufferBase extends java.lang.Object implements ParameterBuffer, java.io.Serializable
| Modifier | Constructor and Description |
|---|---|
protected |
ParameterBufferBase(ParameterBufferMetaData parameterBufferMetaData)
Creates a
ParameterBufferBase. |
protected |
ParameterBufferBase(ParameterBufferMetaData parameterBufferMetaData,
Encoding defaultEncoding)
Creates a
ParameterBufferBase. |
| Modifier and Type | Method and Description |
|---|---|
void |
addArgument(int argumentType)
Add argument with no parameters.
|
void |
addArgument(int argumentType,
byte value)
Add a byte argument.
|
void |
addArgument(int type,
byte[] content)
Add array of bytes.
|
void |
addArgument(int argumentType,
int value)
Add integer argument.
|
void |
addArgument(int argumentType,
long value)
Add long argument.
|
void |
addArgument(int argumentType,
java.lang.String value)
Add string argument with the default encoding.
|
void |
addArgument(int argumentType,
java.lang.String value,
Encoding encoding)
Add string argument.
|
boolean |
equals(java.lang.Object other) |
int |
getArgumentAsInt(int type)
Get argument as int.
|
java.lang.String |
getArgumentAsString(int type)
Get argument as string.
|
protected java.util.List<Argument> |
getArgumentsList() |
Encoding |
getDefaultEncoding() |
protected int |
getLength() |
ParameterBufferMetaData |
getParameterBufferMetaData() |
int |
getType() |
boolean |
hasArgument(int type)
Check if this parameter buffer has specified argument.
|
int |
hashCode() |
java.util.Iterator<Parameter> |
iterator()
Returns an iterator over a copy of the parameters in this parameter buffer.
|
void |
removeArgument(int type)
Remove specified argument.
|
int |
size() |
byte[] |
toBytes()
Converts this parameter buffer to a byte array.
|
byte[] |
toBytesWithType()
Converts this parameter buffer to a byte array with type information.
|
Xdrable |
toXdrable() |
void |
writeArgumentsTo(java.io.OutputStream outputStream)
Writes the arguments in the implementation specific serialization into the
OutputStream. |
protected ParameterBufferBase(ParameterBufferMetaData parameterBufferMetaData)
ParameterBufferBase.
This uses a default encoding derived from the system default encoding. You usually want to
use ParameterBufferBase(ParameterBufferMetaData, Encoding) instead.
parameterBufferMetaData - Metadata for the parameter buffer.protected ParameterBufferBase(ParameterBufferMetaData parameterBufferMetaData, Encoding defaultEncoding)
ParameterBufferBase.parameterBufferMetaData - Metadata for the parameter buffer.defaultEncoding - Default encoding to use for string argumentspublic final Encoding getDefaultEncoding()
public final ParameterBufferMetaData getParameterBufferMetaData()
public final int getType()
getType in interface ParameterBufferpublic final void addArgument(int argumentType,
java.lang.String value)
ParameterBufferaddArgument in interface ParameterBufferargumentType - type of argument.value - string value to add.public final void addArgument(int argumentType,
java.lang.String value,
Encoding encoding)
ParameterBufferaddArgument in interface ParameterBufferargumentType - type of argument.value - string value to add.encoding - encoding to use for conversion to bytespublic void addArgument(int argumentType,
byte value)
ParameterBufferaddArgument in interface ParameterBufferargumentType - type of argument.value - byte value to add.public final void addArgument(int argumentType,
int value)
ParameterBufferaddArgument in interface ParameterBufferargumentType - type of argument.value - integer value to add.public final void addArgument(int argumentType,
long value)
ParameterBufferaddArgument in interface ParameterBufferargumentType - type of argument.value - long value to add.public final void addArgument(int argumentType)
ParameterBufferaddArgument in interface ParameterBufferargumentType - type of argument.public final void addArgument(int type,
byte[] content)
ParameterBufferaddArgument in interface ParameterBuffertype - type of argument.content - content of argument.public final java.lang.String getArgumentAsString(int type)
ParameterBuffergetArgumentAsString in interface ParameterBuffertype - type of argument to find.null if nothing found.public final int getArgumentAsInt(int type)
ParameterBuffergetArgumentAsInt in interface ParameterBuffertype - type of argument to find.0 if nothing found.public final boolean hasArgument(int type)
ParameterBufferhasArgument in interface ParameterBuffertype - type of argument to find.true if this buffer contains specified argument.public final void removeArgument(int type)
ParameterBufferremoveArgument in interface ParameterBuffertype - type of argument to remove.public final java.util.Iterator<Parameter> iterator()
ParameterBufferIt is safe to iterate over this iterator while modifying the parameter buffer. Changes will not be reflected in the iterator.
iterator in interface java.lang.Iterable<Parameter>iterator in interface ParameterBufferpublic final void writeArgumentsTo(java.io.OutputStream outputStream)
throws java.io.IOException
ParameterBufferOutputStream.writeArgumentsTo in interface ParameterBufferoutputStream - The OutputStream to write tojava.io.IOException - Errors produced by the output stream during writespublic final Xdrable toXdrable()
toXdrable in interface ParameterBufferXdrable to write (and optionally read) this instance as Xdr.protected final int getLength()
protected final java.util.List<Argument> getArgumentsList()
public final byte[] toBytes()
ParameterBufferThis byte array includes the extra header-bytes (if any), but does not include the type information
toBytes in interface ParameterBufferParameterBuffer.toBytesWithType()public final byte[] toBytesWithType()
ParameterBufferThis byte array includes the type information and the extra header bytes (if any).
toBytesWithType in interface ParameterBufferParameterBuffer.toBytes()public final int size()
size in interface ParameterBufferpublic final boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.ObjectCopyright © 2001-2023 Jaybird (Firebird JDBC) team. All rights reserved.