From 7a0b4fed1cfa0934091355444cc4bc2fb48997ac Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 05 Nov 2015 12:25:28 +0000
Subject: [PATCH] OPENDJ-1802 Make ByteSequenceReader methods more intentional
---
opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java b/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
index aa614c2..553a33b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
@@ -89,9 +89,9 @@
throws DirectoryException
{
// First decode the encoded attribute description id.
- final int length = reader.getBERLength();
+ final int length = reader.readBERLength();
final byte[] idBytes = new byte[length];
- reader.get(idBytes);
+ reader.readBytes(idBytes);
final int id = decodeId(idBytes);
// Look up the attribute description.
@@ -114,14 +114,14 @@
}
// Determine the number of values for the attribute.
- final int numValues = reader.getBERLength();
+ final int numValues = reader.readBERLength();
// For the common case of a single value with no options, generate
// less garbage.
if (numValues == 1 && options.isEmpty())
{
- final int valueLength = reader.getBERLength();
- final ByteSequence valueBytes = reader.getByteSequence(valueLength);
+ final int valueLength = reader.readBERLength();
+ final ByteSequence valueBytes = reader.readByteSequence(valueLength);
return Attributes.create(attrType, valueBytes.toByteString());
}
else
@@ -131,8 +131,8 @@
builder.setOptions(options);
for (int i = 0; i < numValues; i++)
{
- final int valueLength = reader.getBERLength();
- final ByteSequence valueBytes = reader.getByteSequence(valueLength);
+ final int valueLength = reader.readBERLength();
+ final ByteSequence valueBytes = reader.readByteSequence(valueLength);
builder.add(valueBytes.toByteString());
}
return builder.toAttribute();
@@ -155,9 +155,9 @@
final ByteSequenceReader reader) throws DirectoryException
{
// First decode the encoded object class id.
- final int length = reader.getBERLength();
+ final int length = reader.readBERLength();
final byte[] idBytes = new byte[length];
- reader.get(idBytes);
+ reader.readBytes(idBytes);
final int id = decodeId(idBytes);
// Look up the object classes.
--
Gitblit v1.10.0