public class BinaryStlFacetDefinitionReader extends Object implements FacetDefinitionReader
Constructor and Description |
---|
BinaryStlFacetDefinitionReader(InputStream in)
Construct a new instance that reads from the given input stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this instance and release all associated resources.
|
ByteBuffer |
getHeader()
Get a read-only buffer containing the 80 bytes of the STL header.
|
String |
getHeaderAsString()
Return the header content as a string decoded using the UTF-8 charset.
|
String |
getHeaderAsString(Charset charset)
Return the header content as a string decoded using the given charset.
|
long |
getNumTriangles()
Get the total number of triangles (i.e.
|
BinaryStlFacetDefinition |
readFacet()
Return the next facet definition from the input source or null if no more
facets are available.
|
public BinaryStlFacetDefinitionReader(InputStream in)
in
- input stream to read from.public ByteBuffer getHeader()
UncheckedIOException
- if an I/O error occurspublic String getHeaderAsString()
UncheckedIOException
- if an I/O error occurspublic String getHeaderAsString(Charset charset)
charset
- charset to decode the header withUncheckedIOException
- if an I/O error occurspublic long getNumTriangles()
UncheckedIOException
- if an I/O error occurspublic BinaryStlFacetDefinition readFacet()
readFacet
in interface FacetDefinitionReader
public void close()
close
in interface AutoCloseable
close
in interface FacetDefinitionReader
Copyright © 2016–2021 The Apache Software Foundation. All rights reserved.