Skip to content

Commit

Permalink
add new API for boundedMemoryDecoder (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
guawang authored Mar 4, 2021
1 parent 0391a2f commit 5ea12f7
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ BinaryDecoder newBinaryDecoder(byte[] bytes, int offset,

Decoder newBoundedMemoryDecoder(InputStream in) throws IOException;

Decoder newBoundedMemoryDecoder(byte[] data) throws IOException;

//parsing and Schema-related

SchemaParseResult parse(String schemaJson, SchemaParseConfiguration desiredConf, Collection<Schema> known);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ public Decoder newBoundedMemoryDecoder(InputStream in) throws IOException {
return new BoundedMemoryDecoder(in);
}

@Override
public Decoder newBoundedMemoryDecoder(byte[] data) throws IOException {
return new BoundedMemoryDecoder(data);
}

@Override
public SchemaParseResult parse(String schemaJson, SchemaParseConfiguration desiredConf, Collection<Schema> known) {
Schema.Parser parser = new Schema.Parser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ public Decoder newBoundedMemoryDecoder(InputStream in) throws IOException {
return new BoundedMemoryDecoder(in);
}

@Override
public Decoder newBoundedMemoryDecoder(byte[] data) throws IOException {
return new BoundedMemoryDecoder(data);
}

@Override
public SchemaParseResult parse(String schemaJson, SchemaParseConfiguration desiredConf, Collection<Schema> known) {
SchemaParseResult result = Avro14SchemaAccessUtil.parse(schemaJson, known);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ public Decoder newBoundedMemoryDecoder(InputStream in) throws IOException {
return new BoundedMemoryDecoder(in);
}

@Override
public Decoder newBoundedMemoryDecoder(byte[] data) throws IOException {
return new BoundedMemoryDecoder(data);
}

@Override
public SchemaParseResult parse(String schemaJson, SchemaParseConfiguration desiredConf, Collection<Schema> known) {
Schema.Parser parser = new Schema.Parser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ public Decoder newBoundedMemoryDecoder(InputStream in) throws IOException {
return new BoundedMemoryDecoder(in);
}

@Override
public Decoder newBoundedMemoryDecoder(byte[] data) throws IOException {
return new BoundedMemoryDecoder(data);
}

@Override
public SchemaParseResult parse(String schemaJson, SchemaParseConfiguration desiredConf, Collection<Schema> known) {
Schema.Parser parser = new Schema.Parser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ public Decoder newBoundedMemoryDecoder(InputStream in) throws IOException {
return new BoundedMemoryDecoder(in);
}

@Override
public Decoder newBoundedMemoryDecoder(byte[] data) throws IOException {
return new BoundedMemoryDecoder(data);
}

@Override
public SchemaParseResult parse(String schemaJson, SchemaParseConfiguration desiredConf, Collection<Schema> known) {
Schema.Parser parser = new Schema.Parser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ public Decoder newBoundedMemoryDecoder(InputStream in) throws IOException {
return new BoundedMemoryDecoder(in);
}

@Override
public Decoder newBoundedMemoryDecoder(byte[] data) throws IOException {
return new BoundedMemoryDecoder(data);
}

@Override
public SchemaParseResult parse(String schemaJson, SchemaParseConfiguration desiredConf, Collection<Schema> known) {
Schema.Parser parser = new Schema.Parser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ public Decoder newBoundedMemoryDecoder(InputStream in) throws IOException {
return new BoundedMemoryDecoder(in);
}

@Override
public Decoder newBoundedMemoryDecoder(byte[] data) throws IOException {
return new BoundedMemoryDecoder(data);
}

@Override
public SchemaParseResult parse(String schemaJson, SchemaParseConfiguration desiredConf, Collection<Schema> known) {
Schema.Parser parser = new Schema.Parser();
Expand Down

0 comments on commit 5ea12f7

Please sign in to comment.